<?php
require_once ROOT_ADMIN_MODELS.DS.'Models_Base.php';
require_once(ROOT_ADMIN_OBJECT.DS.'Objs_Log.php');
class Models_Log extends Models_Base{		    
    public function __construct(){
    	parent::__construct();
       // $this->db=Zend_Registry::get('db');
       $this->_key="id";
       $this->_table="log";
    }
	public static function insert($user,$action,$note=null)
	{
		$obj = new Objs_Log();		
		$obj->actionDate = date("Y-m-d H:i:s");
		$obj->user_id=$user;
		$obj->action = $action;		
		$obj->note = $note;		
		$data = Utility::transferObjectToArray($obj);		
		$db = Zend_Registry::get("db");
		$db->insert('log', $data);
	}
}
		